<?php
class Mwc_SystemPoint_Block_Viplist_List_Grid extends Mage_Adminhtml_Block_Widget_Grid{
    public function __construct(){
        parent::__construct();
        $this->setId('viplistGrid');
        $this->_controller = 'systempoint';
    }

    protected function _prepareCollection(){
        $model = Mage::getModel('systempoint/viplist');
        $collection = $model->getCollection();
        $this->setCollection($collection);

        return parent::_prepareCollection();
    }

    protected function _prepareColumns(){
        $this->addColumn('email', array(
            'header'        => Mage::helper('systempoint')->__('VIP email'),
            'align'         => 'left',
            'width'         => '150px',
            'filter_index'  => 'email',
            'index'         => 'email',
        ));

        $this->addColumn('date', array(
            'header'    	=> Mage::helper('systempoint')->__('Upgrade date'),
            'align'         => 'left',
            'filter_index'  => 'date',
            'index'    	 	=> 'date',
        ));

        $this->addColumn('action',
            array(
                'header'    => Mage::helper('systempoint')->__('Action'),
                'width'     => '150px',
                'type'      => 'action',
                'getter'	=> 'getViplistId',
                'actions'   => array(
                    array(
                        'caption' => Mage::helper('systempoint')->__('Delete'),
                        'url'     => array(
                            'base'=>'*/*/delete'
                        ),
                        'field'   => 'id'
                    )
                ),
                'filter'    => false,
                'sortable'  => false
            ));

        return parent::_prepareColumns();
    }
}